feat: implement course progress persistence - #115
Merged
ayomideadeniran merged 8 commits intoMar 27, 2026
Merged
Conversation
…eset functionality
…g and updating student progress
- Regenerate backend/package-lock.json (missing deps from lock file) - Fix rustfmt formatting in contracts/src/token.rs (multi-line use statement) - Replace 'any' types with proper types in frontend (no-explicit-any lint errors) - auth/login, auth/register, verify, certificates pages: catch(err: unknown) - AuthContext: catch(err: unknown) with instanceof Error narrowing - api.ts: Promise<Record<string, unknown>> for untyped API responses - soroban.ts: eslint-disable for unavoidable SDK type assertion
- Backend: remove unused catch variables across routes, fix no-explicit-any errors - Backend: clean up unused imports (adapter, loginSchema, PrismaPg) - Frontend: add proper TypeScript interfaces for dashboard, feedback, certificate APIs - Frontend: fix react/no-unescaped-entities in ideas/page.tsx - Frontend: fix verificationResult type annotation in certificates page
emmanuelist
force-pushed
the
feat/course-progress-persistence
branch
from
March 26, 2026 12:06
5365134 to
7a236e8
Compare
- Backend: fix no-explicit-any in enrollments.ts, routes/index.ts, tests - Backend: remove unused catch(error) variables in learning.routes.ts - Backend: replace @ts-ignore with @ts-expect-error in generator.test.ts - Frontend: run Prettier --write to fix formatting in 20 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35
Implements database-backed course progress persistence. Previously,
learning.service.tsused an in-memoryMapthat lost all progress on server restart. Now everything goes through Prisma → PostgreSQL.What changed
New file:
backend/src/learning/progress.tsgetProgress(studentId)— retrieves persisted progress from PostgreSQL via Prisma, returns defaults for new studentsrecordStageCompletion({ studentId, stageId, moduleId }, totalLessons)— idempotently records a completed stage, recalculates percentageresetProgress(studentId)— clears all progress for a studentCompletedStageandStudentProgressinterfaces designed for future module types (quizzes, projects, etc.)Updated:
backend/src/routes/learning/learning.service.tsMapstorage with calls to the newprogress.tspersistence modulegetStudentProgressandupdateProgressnow delegate to Prisma-backed functionsUpdated:
backend/src/routes/learning/learning.routes.tsprismaimport — all DB access goes through the serviceNew file:
backend/tests/progress.test.tsRequirements from issue
backend/src/learning/progress.tsCompletedStageinterface withstageId,moduleId,completedAt)Data structure
How to test